;Edit *.DAT files
;
(defun c:eddat ( / )
  (IF check_for_doslib NIL (LOAD "check_for_doslib" "\nFile CHECK_FOR_DOSLIB.LSP not loaded! "))
  (check_for_doslib)
  (setq
    edfil (dos_getfiled "Edit Data (text) File"
		    (STRCAT (getvar "dwgprefix")
			    (SUBSTR (GETVAR "DWGNAME")
				    1
				    (- (STRLEN (GETVAR "DWGNAME")) 4)
			    ) ;_ end of SUBSTR
		    ) ;_ end of STRCAT
		    "Data File|*.dat||"
	  ) ;_ end of getfiled
  ) ;_ end of setq
  (if (and(not edfil)(NOT(FINDFILE(STRCAT (getvar "dwgprefix")
			    (SUBSTR (GETVAR "DWGNAME")
				    1
				    (- (STRLEN (GETVAR "DWGNAME")) 4)
			    ) ;_ end of SUBSTR
			    ".dat"
		    ))))
    (setq
      edstr (strcat "NOTEPAD.EXE \""
		    (getvar "dwgprefix")
		    (SUBSTR (GETVAR "DWGNAME")1(- (STRLEN (GETVAR "DWGNAME")) 4))
		    ".dat\""
	    )
    ) ;_ end of setq
    (if edfil
      (setq edstr (strcat "NOTEPAD.EXE \"" edfil "\""))
    )
  )
  (IF edstr
    (command ".START" edstr)
    (PRINC "\nFile not found! ")
  )
);defun
